1. Field of the Invention
This invention relates to an image processing method and device for carrying out pseudo-gradation processing on an image by a dither method.
2. Prior Art
When an image is to be out putted e.g. from a workstation, a personal computer, or a word processor (including a personal computer having a word processing program installed therein) to a display device (various kinds of displays) or a printing device (various kinds of printers), an original image cannot be output as it is, dependent on the specifications of the display device or the printing device. To output image data represented by matrix data (hereinafter simply referred to as a xe2x80x9cmatrixxe2x80x9d) having gradation values representative of e.g. 256 gradation levels assigned to matrix elements thereof, that is, image data (gradation image data) having information of an n-valued gradation value (n=256 in this embodiment) assigned to each pixel, to a tape printing apparatus capable of processing only image data with a smaller (limited) number of gradation values representative of respective gradation levels, it is required to convert the above image data to one (pseudo-gradation image data) adapted to the limited number of gradation values. One of methods used in such image conversion (compression) processing, that is, pseudo-gradation processing is a so-called dither method. It should be noted that xe2x80x9cn-valued gradation valuexe2x80x9d is intended throughout the specification to mean xe2x80x9cgradation value capable of having any one of n possible numerical valuesxe2x80x9d, and hence xe2x80x9c5-valued gradation valuexe2x80x9d, for instance, is a xe2x80x9cgradation value which can have any one of five possible valuesxe2x80x9d. Further, xe2x80x9cn-valued matrixxe2x80x9d is intended throughout the specification to mean xe2x80x9cmatrix of matrix elements each capable of having any one of n possible numerical valuesxe2x80x9d, and hence xe2x80x9c5-valued matrixxe2x80x9d, for instance, is a xe2x80x9cmatrix of matrix elements which can have any one of five possible valuesxe2x80x9d.
The dither method is employed to superimpose noise on gradation values of pixels constituting gradation image data of an original image and then carry out binarization (binary dither method) or limited multi-valued conversion (multi-valued dither method) on values resulting from the superimposition. This method takes advantage of the integrating function of human eyes that recognize contents in an area as a shade or a color. In the binary dither method, for instance, the ratio of assignment of two numerical values (e.g. 1""s and 0""s) to matrix elements of a matrix are changed according to the gradation values of respective pixels of an input gradation image (for instance, by thinning xe2x80x9c1""sxe2x80x9d in the matrix according to the gradation values under a predetermined rule) to thereby represent intermediate gradation (for instance, a gray color represented by setting 1""s and 0""s to black and white, respectively). A typical binary dither method is a systematic dither method.
In the systematic dither method, first, for comparison with n-valued gradation values each defined by any one of n possible numerical values (n is an integer equal to or larger than 3) and assigned to pixels forming an original gradation image, a dither matrix of thresholds each defined by any one of m possible numerical values (m is an integer satisfying a condition of nxe2x89xa7mxe2x89xa72) and arranged therein as matrix elements is prepared beforehand. Next, (the matrix of) the original gradation image is divided into matrices each having the size of the dither matrix, and the gradation values of the respective elements of each of the divisional matrices and the corresponding thresholds of the dither matrix are compared with each other on an element-by-element basis to determine whether or not a gradation value satisfies a condition designated by a corresponding threshold. According to results of the determination, either of the numerical values 1 and 0 is assigned to each pixel to thereby form a pseudo-gradation image represented by a binary matrix. For instance, if the gradation value of a matrix element satisfies a condition designated by a corresponding threshold, a numerical value (e.g. 1) indicating validity of the gradation value is assigned to a corresponding matrix element, whereas if the gradation value does not satisfy the condition, a numerical value (e.g. 0) indicating invalidity of the gradation value is assigned to the corresponding matrix element, whereby a pseudo-gradation image represented by a two-valued (binary) matrix (i.e. of matrix elements each having a value 1 or 0) is formed.
By definition of relationship between gradation values and thresholds therefor, the gradation value of each matrix element which is equal to or larger than a corresponding threshold, larger than the threshold, equal to or smaller than the same, or smaller than the same, for instance, can be a gradation value satisfying a condition designated by the corresponding threshold. In the following, the dither method will be described based on a case, for example, in which a gradation value equal to a corresponding threshold also satisfies a condition (i.e. the condition is that the gradation value is equal to or larger than the threshold or that the gradation value is equal to or smaller than the corresponding threshold). Of course, even when the condition is defined such that it is not satisfied when a gradation value=a threshold holds, the gradation values can be processed based on the same principles.
The multi-valued dither method is a dither method in which, a converted (compressed) image, that is, a pseudo-gradation image is not an image represented by a binary matrix (binary image) but an image represented by a multi-gradation matrix of matrix elements having three or more gradation values (multi-valued image). However, it can be processed in the same manner as carried out in the binary dither method. For instance, when a gradation image with 256 gradation values ranging from 0 to 255 is processed, the 256 gradation values are classified into e.g. four ranges of gradation levels, that is, range 1 from 0 to 64, range 2 from 64 to 128, range 3 from 128 to 192 and range 4 from 192 to 255, and dither matrices are provided for application of the systematic dither method to respective ranges of gradation values. Further, two values representative of results of the application of the systematic dither method to range 1 are defined as 0 and 1, two values for range 2 as 1 and 2, two values for range 3 as 2 and 3, and two values for range 4 as 3 and 4. Then, when the systematic dither method is carried out on each range of gradation values, a 5-valued pseudo-gradation image represented by five gradation values of 0 to 4 can be formed. Of course, if the binary dither method is further carried out on such a multi-valued (e.g. 5-valued) pseudo-gradation image, it is also possible to finally obtain a two-valued or binary pseudo-gradation image.
The above pseudo-gradation processing by the dither method (hereinafter referred to as xe2x80x9cditheringxe2x80x9d) can be applied not only to a monochrome image (gradation image having gradation values of gray tones) but also to a color image. That is, in this case, it is only required to carry out the dithering (color dithering) on gradation values of each of basic colors, such as three primary colors. For instance, to form a pseudo-gradation image as a display image to be output to a display or the like, it is only required to carry out dithering of gradation values of each of three primary colors, i.e. R (red), G (green) and B (blue), separately, whereas to form a pseudo-gradation image as a print image for printing, it is only required to carry out dithering of gradation values of each of three primary colors, i.e. C (cyan), M (magenta) and Y (yellow), separately. In the latter case, alternatively, dithering of gradation values of each of four basic colors, i.e. C, M, Y plus K (black) may be separately performed.
In the above dithering, however, a gradation image represented by a matrix in which n-valued gradation values (nxe2x89xa73: in the above example, n=256) representative of respective gradation levels are used as matrix elements, that is, a gradation image having information of n gradation levels or n-valued gradation values (n=256 in this example) each assigned to a pixel is subjected to the image processing. Further, in the pseudo-gradation processing by the multi-valued dither method (multi-valued dither process), the capacity of the memory device for storing a multi-valued (5-valued, for instance) pseudo-gradation image as a result of the dithering is required. Further, a comparing operation between a gradation image and a dither matrix carried out as a basic process takes a very long processing time. Particularly in the color dithering, basic colors are processed on a primary color-by-primary color basis, and hence the problems of the capacity of the memory device and the long processing time become serious.
In a word processor and the like, when characters including letters, numerals, symbols, graphics and the like (hereinafter generically referred to as xe2x80x9ccharactersxe2x80x9d) are input to display and print a character string having each of input characters as an element thereof, minimum units for carrying out color specification or the like are characters. Further, in a case where reversed images of characters are to be printed, or in a case where background colors can be set, it is possible to specify a color of the background of characters. Furthermore, in the above case of a character string being displayed and printed, if an image of a character string formed as a display image or a print image is regarded as a whole image, an image of each character included in the character string is an image element.
In the above case, when a character shape image which forms a body or object of each image element is defined as an elementary object image and an image of a background of the elementary object image is defined as an elementary background image, out of pixels of each image element, pixels of an elementary object image of the image element and pixels of an elementary background image as a background of the elementary object image can be discriminated through viewing the same on a display image or a print image. Correspondingly, when image data is processed, out of elements of a matrix representing the image element, matrix elements corresponding to pixels of the elementary object and matrix elements corresponding to pixels of the elementary background image can be distinguished from each other. Further, in this case, gradation values are separately set to the elementary object image and the elementary background image, respectively. That is, all the pixels of the elementary object image are set to an identical gradation value, and all the pixels of the elementary background image are set to an identical gradation value different from that of the elementary object image. It should be noted that in the above case of reversed images of characters, it is possible to regard a background of each character as an elementary object image and the character itself as an elementary background image of the elementary object image.
Similar images can be formed not only by a word processor as a so-called character entry device but also by an image input device (including a personal computer and the like having plotting software (design software) installed therein) which is capable of plotting a desired diagram or a picture for entry. More specifically, also when a diagram or a picture as part of a whole image has a gray tone or color designated therefor, an image of the diagram or picture is an image element, and an image in the shape of the diagram or the picture as a body or object of the image element corresponds to an elementary object image, and can be distinguished from an elementary background image as a background thereof. At least all the pixels of the elementary object image are set to an identical gradation value. Further, however complicated a plotted image is, it can be decomposed into image elements by regarding the plotted image as a synthesized image (whole image) formed by synthesizing the image elements in each of which at least all the pixels of an elementary object image thereof have an identical gradation value. Further, each image element can be decomposed into an elementary object image and an elementary background image other than the elementary object image. The elementary object image and the elementary background image can be distinguished from each other, with at least all the pixels of the elementary object image having an identical gradation value. It should be noted that an image, which is intuitively perceived as a background image, can be regarded as an object image through a change in viewpoint.
Next, differences between gradation values of an elementary object image and those of an elementary background image will be considered. Even if the elementary object image and elementary background image of a single image element can be distinguished from each other as described above, if the difference in gradation value (in density or gray tone) between them is small, e.g. when the density of the elementary object image is low with reference to that of the elementary background image, a boundary (contour line or the like) between the images becomes unclear when the image element is displayed or printed, thereby causing so-called blur to be produced. However, if the gradation values of the elementary object image, for instance, are corrected in a manner such that the density of the elementary object image is uniformly increased, irrespective of the original (designated) gradation values thereof, there is no difference between the present correction case and a case where gradation values close to maximum density are designated for the elementary object image from the very start, which prevents the user""s intention from being reflected in the resulting image. Particularly when color images are corrected in such a fashion, the relationship among three or four basic colors can be made unbalanced or far from expressing a desired color tone, producing a different color from one intended by the user.
Further, when the difference in density is generally and uniformly increased (e.g. the elementary object image is increased in density), a so-called collapse of dots (to form a solid black area) or the like is produced. The same inconvenience occurs in a whole image as well, which causes relationship between the image elements to be made unbalanced or collapse of dots through interference between the same. Particularly when an image is output to the printing apparatus, that is, when a print image is formed by carrying out the dithering, if the gradation values of an elementary object image, for instance, are corrected in a manner such that the density of the elementary object image is uniformly increased, the printing apparatus suffers from the problem that the amount of ink droplets to be ejected onto a unit area of a printing object exceeds a limit of the amount of ink which can be absorbed by the unit area (hereinafter referred to as an xe2x80x9cejection amount-limiting valuexe2x80x9d).
It is a first object of the invention to provide an image processing method and device which permits the dithering to be carried out on a whole image, at least one image element of which has an elementary object image as a body or object thereof whose pixels are distinguishable from the pixels of an elementary background image as the background of the elementary object image, with at least all the pixels of the elementary object image having an identical gradation value, while saving the capacity of a memory device and shortening processing time of the apparatus.
It is a second object of the invention to provide an image processing method and device which permits the dithering to be carried out on the aforementioned whole image, while saving the capacity of the memory device and shortening processing time of the apparatus, as well as preventing formation of so-called blurs or broken lines.
It is a third object of the invention to provide an image processing method and device which permits the dithering to be carried out on the aforementioned whole image, while saving the capacity of the memory device and shortening processing time of the apparatus, as well as reflecting the user""s intention and preventing formation of blurs or collapse of dots.
To attain the first object, according to a first aspect of the invention, there is provided a method of carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with n-valued gradation values (n is an integer which is equal to or larger than 3, and at the same time nxe2x89xa7m) each assigned to a pixel and having any one of n possible numerical values.
The method according to the first aspect of the invention is characterized by comprising the steps of:
forming and storing an elementary shape image represented by a first two-valued matrix of predetermined two values, for each of at least one selected image element of a whole image having at least one image element including the at least one selected image element, the at least one selected image element each having pixels which can be divided into pixels forming an elementary object image and pixels forming an elementary background image as a background of the elementary object image, by assigning a validity-indicative one of the two predetermined values to all of the pixels forming the elementary object image, and an invalidity-indicative one of the two predetermined values to all of the pixels forming the elementary background image;
storing, for each corresponding one of the at least one selected image element, one of the n possible numerical values as a designated gradation value commonly applied to the all of the pixels forming the elementary object image;
storing a dither mask represented by a second two-valued matrix of the two predetermined values identical in size to the dither matrix, the second two-valued matrix formed by assigning the validity-indicative one of the predetermined two values to matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value satisfies a validity condition, and assigning the invalidity-indicative one of the predetermined two value to remaining matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value does not satisfy the validity condition; and
forming a dithered image element represented by a third two-valued matrix of the predetermined two values, the dithered image element being identical in size to the dither mask, by carrying out a logical AND operation between each of matrix elements of each of matrices forming the elementary shape image, the each of the matrices being identical in size to the dither mask, and a corresponding one of the matrix elements and the remaining matrix elements of the dither mask, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements and the corresponding one both have the validity-indicative value.
To attain the first object, according to a second aspect of the invention, there is provided an image processing device for carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with n-valued gradation values (n is an integer which is equal to or larger than 3, and at the same time nxe2x89xa7m) each assigned to a pixel and having any one of n possible numerical values.
The image processing device according to the second aspect of the invention is characterized by comprising:
elementary shape image-forming means for forming and storing an elementary shape image represented by a first two-valued matrix of predetermined two values, for each of at least one selected image element of a whole image having at least one image element including the at least one selected image element, the at least one selected image element each having pixels which can be divided into pixels forming an elementary object image and pixels forming an elementary background image as a background of the elementary object image, by assigning a validity-indicative one of the two predetermined values to all of the pixels forming the elementary object image, and an invalidity-indicative one of the two predetermined values to all of the pixels forming the elementary background image;
designated gradation value storage means for storing, for each corresponding one of the at least one selected image element, one of the n possible numerical values as a designated gradation value commonly applied to the all of the pixels forming the elementary object image;
dither mask storage means for storing a dither mask represented by a second two-valued matrix of the two predetermined values identical in size to the dither matrix, the second two-valued matrix formed by assigning the validity-indicative one of the predetermined two values to matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value satisfies a validity condition, and assigning the invalidity-indicative one of the predetermined two value to remaining matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value does not satisfy the validity condition; and
dithered image element-forming means for forming a dithered image element represented by a third two-valued matrix of the predetermined two values, the dithered image element being identical in size to the dither mask, by carrying out a logical AND operation between each of matrix elements of each of matrices forming the elementary shape image, the each of the matrices being identical in size to the dither mask, and a corresponding one of the matrix elements and the remaining matrix elements of the dither mask, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements and the corresponding one both have the validity-indicative value.
According to the image processing method and device, for each of at least one selected image element of a whole image having at least one image element including the at least one selected image element, the at least one selected image element each having pixels which can be divided into pixels forming an elementary object image and pixels forming an elementary background image as a background of the elementary object image, a validity-indicative one of the two predetermined values is assigned to all of the pixels forming the elementary object image, and an invalidity-indicative one of the two predetermined values to all of the pixels forming the elementary background image, thereby forming an elementary shape image represented by a first two-valued matrix of the predetermined two values. In short, there is obtained an elementary shape image represented by two-valued (binary) matrix in which the validity-indicative value is assigned to all the pixels of the elementary object image and the invalidity-indicative value to all the pixels of the elementary background image. Further, for all the pixels of the elementary object image, one of the n possible numerical values is stored as an identical designated gradation value.
In this case, it is only required to store one of binary values (indicative of validity and invalidity, respectively, e.g. xe2x80x9c1xe2x80x9d and xe2x80x9c0xe2x80x9d) as information of each pixel of each elementary object image, even if the designated gradation value is stored separately from information of each pixel, so that the memory capacity can be made smaller than when information of an n-valued gradation value (nxe2x89xa73) is stored for each pixel (on a pixel-by-pixel basis).
Further, in this case, the above elementary shape image may be formed based on an image (gradation image) having information of an n-valued gradation value for each pixel and at the same time a designated gradation value may be extracted. Alternatively, the elementary shape image may be formed separately from the designation of a designated gradation value from the beginning. For instance, when the elementary shape image is formed based on a gradation image produced by using the personal computer or the like, a method corresponding to the former may be employed, whereas when characters are entered via the keyboard of a word processor or the like, and a gradation value is designated (gray tone or color designation) on a character-by-character basis for forming an image element, a method corresponding to the latter may be employed.
In the image processing method and device, a dither mask is stored which is represented by a two-valued (binary) matrix having a size identical to a dither matrix. More specifically, as a dither mask, there is stored a matrix in which a validity-indicative one of two predetermined numerical values is assigned to each matrix element corresponding in matrix element location to each threshold of the dither matrix whose condition is satisfied by a designated gradation value, whereas an invalidity-indicative one of the two predetermined numerical values is assigned to each matrix element corresponding in matrix element location to each threshold of the dither matrix whose condition is not satisfied by the designated gradation value.
The dither mask in this case coincides with (the matrix of) a pseudo-gradation image as an image resulting from the binary dither process which is carried out by using the dither matrix on a predetermined gradation image having the same size as that of the dither matrix. In other words, the dither mask coincides with a matrix resulting from a binarization process in which, when a gradation image having the same size as that of the dither matrix has information of an n-valued gradation value per pixel, and at the same time information of gradation values for all the pixels indicates the above designated gradation value, the gradation value of each pixel of the gradation image is compared with each corresponding threshold in the dither matrix and then, the result of the comparison is binarized. It should be noted that in the above case, a dither mask for each of possible designated gradation values may be stored in advance, or a dither mask may be newly produced for storage by comparing a designated gradation value with each threshold in a dither matrix, after the designated gradation value is determined. In the former case, it is possible to omit computing time to thereby shorten processing time of the whole image processing operation. In the latter case, the capacity of the memory device for storing dither masks can be saved. In addition, since the above comparing operations are carried out between matrices having the size of the dither matrix, only relatively short processing time is required therefor.
Further, in the image processing method and device, a logical AND operation is performed between each matrix element of each of matrices of respective portions of an elementary shape image, each of the matrices having the same size as that of the dither mask, and a corresponding one (matrix element corresponding in matrix element location) of the matrix elements of the dither mask, such that a validity-indicative value is output only when both an element of each of the matrices of the respective portions of the elementary shape image and a corresponding matrix element of the dither mask have the validity-indicative value. As a result of the logical AND operation, there is produced a dithered image element represented by a predetermined binary matrix having a size identical to that of the elementary shape image.
More specifically, conventionally, the gradation value of each pixel of each image element matrix having the same size as that of the dither matrix is compared with a corresponding one of the thresholds of the dither matrix, to thereby obtain a pseudo-gradation image. In the image processing method and device, however, to obtain the same advantageous effect, it is only required to perform a simple logical AND operation, whereby it is possible to enhance processing speed (shorten processing time) of the apparatus. Moreover, since the inputs (a dither mask, and a matrix representing an elementary shape image) and output (matrix of dithered image element as a result) of the logical AND operation are represented by binary matrices, the capacity of the memory device can be saved. Of course, when similar processing can be carried out not only on image elements as portions of a whole image but also on the whole image itself, that is, when all the image elements can be divided into elementary object images and elementary background images, binary matrices are applied to the whole image, whereby it is possible to further save the capacity of the memory device as well as shorten processing time of the apparatus.
In the case of the conventional image processing method and device, an original designated gradation value of n is stored as gradation value information of each pixel, so that even if a multi-valued (e.g. 5-valued, described above) pseudo-gradation image is formed, information of the gradation value n is lost. Further, when the pseudo-gradation image is binarized, even multi-valued information thereof is lost. The same applies to the case of the binary dither process being carried out from the beginning, in which the information of the gradation value n is lost by binarization. In other words, to reconfirm a set or determined (designated) gradation value on a display screen, it is required to store an original gradation image, which necessitates an extra capacity of the memory. Further, even when an identical gradation value is designated for all the pixels of the elementary object image of an image element, the fact can not be viewed collectively, so that it is required that the gradation values of all the pixels of the gradation image are displayed or printed for viewing pixel by pixel. In the image processing method and device, however, when an identical gradation value is designated for all the pixels of the elementary object image of an image element, the gradation value designated for the elementary object image is stored separately from information of each pixel, so that the capacity of the memory device can be saved, and at the same time the designated identical gradation value can be collectively and directly confirmed or viewed (by displaying or printing the same, for instance).
For the above reason, in the image processing method and device, the dithering can be carried out on a whole image, at least one image element of which has an elementary object image as a body or object thereof whose pixels are distinguishable from the pixels of an elementary background image as the background of the elementary object image. In this case, all the pixels of at least the elementary object image have an identical gradation value. Therefore, the image processing method makes it possible to save the capacity of the memory device as well as shorten processing time.
Although in the above examples, description is made of a case in which characters are entered via a keyboard and gradation values are designated (a gray tone and a color thereof are designated) for each of the characters to thereby form an image element, this is not limitative, but when gradation values can be designated (a gray tone and a color thereof can be designated) for the background of each of the characters, the background is treated as an elementary object, whereby it is possible to form a dithered image element for the background of the character. This method is suitable for forming dithered image elements in the case of reversed character images of characters. In addition, it can also be applied to obtaining a dithered image element which is formed by carrying out the dithering of a dithered image element for a character as an elementary object image and a dithered image element for the background of the character as an elementary object image combined with (superimposed on) the dithered image element for the character.
Further, however complicated a plotted image is, if it is regarded as a synthesized image (whole image) formed by synthesizing image elements in which at least all the pixels of elementary object images thereof have identical gradation value to each other, the plotted image can be decomposed into each image element. Further, each image element can be decomposed into an elementary object image and an elementary background image other than the elementary object image, and the elementary object image and the elementary background image can be distinguished from each other. Therefore, dithered image elements corresponding to respective image elements are produced to combine the same (superimpose corresponding matrix elements), whereby it is possible to obtain a dithered image element as well, formed by carrying out the dithering of a complicated plotted image.
Similarly, the above image processing method and device can be applied to processing of color images. In this case, the color dithering is carried on the gradation value of each of the three primary colors R, G, B or C, M, Y, or alternatively, each of the four basic colors C, M, Y and K and then, dithered image elements for respective colors may be obtained for combining the same. Further, in this case, after dithered image elements for the respective colors C, M, and Y are obtained, a pixel (matrix element) having a validity-indicative value commonly among the dithered image elements is extracted, whereby it is also possible to obtain a dithered image element for a color K.
Preferably, the predetermined two values are 1 and 0.
According to this preferred embodiment of each of the first and second aspects of the invention, since the two predetermined numerical values are 1 and 0, each pixel can be represented by one bit in one binary digit, so that the memory capacity can be made small. Additionally, the above logical AND operations are logical AND operations performed by using AND elements arranged by one element per pixel or a corresponding program, and it is easy to carry out the operations on a matrix having a size equal to that of a dither matrix or a larger matrix including a plurality of matrices of the same size as the matrix, on a matrix by matrix basis, so that processing time of the apparatus can be further shortened.
More preferably, if the each of the at least one selected image element is a monochrome image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing a gradation value indicative of a shading of the monochrome image as the designated gradation value.
More preferably, if the each of the at least one selected image element is a monochrome image,
the designated gradation value storage means stores a gradation value indicative of a shading of the monochrome image as the designated gradation value.
According to these preferred embodiments, when image elements are monochrome images, gradation values indicating the gray tones of the images are stored as designated gradation values. Hence, the image elements can be applied to dithering of the gray tones of monochrome image elements.
Preferably, if the each of the at least one selected image element is a color image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the step of storing the dither mask comprises the step of storing at least one primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the primary color gradation value; and
the step of forming the dithered image element comprises the step of forming three dithered primary color image elements each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the at least one primary color dither mask as an operand.
Preferably, if the each of the at least one selected image element is a color image,
the designated gradation value storage means stores primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the dither mask storage means stores at least one primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the primary color gradation value; and
the dithered image element-forming means forms three dithered primary color image elements each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the at least one primary color dither mask as an operand.
According to these preferred embodiments, when the image element is a color image, the primary color gradation value of each of the three primary colors is stored as a type of designated gradation value, primary color dither masks corresponding to at least two primary color gradation values different from each other are each stored as a type of dither mask, and primary color dithered image elements corresponding to primary color dither masks are each formed as a kind of dithered image element. That is, when all the primary color gradation values of the three primary colors are identical to each other, at least one primary color dithered image element is formed, and when two of the primary color gradation values of the three primary colors are identical to each other, at least two primary color dithered image elements are formed. Further, when the three primary color gradation values are all different from each other, at least three primary color dithered image elements are formed. In this case, when all the primary color gradation values are identical to each other, one primary color dithered image element is made duplicate use of for the three primary colors, and when two of the primary color gradation values are identical to each other, two primary color dithered image elements are made duplicate use of for the two primary colors. In short, primary color dithered image elements for the three primary colors can be obtained. Therefore, the present image processing method and device can be applied to dithering concerning the primary color gradation values of the three primary colors of a color image element.
In the above case, primary color dither masks for respective possible primary color gradations values may be stored in advance as dither masks. Alternatively, a primary color dither mask may be newly formed for storage by comparing a primary color gradation value with each threshold in a dither matrix, after the primary color gradation value is determined.
More preferably, the method includes the step of forming, as an additional kind of the dithered image element, a dithered mixed color image element in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the three dithered primary color image elements all of which are commonly assigned the validity-indicative value.
More preferably, the image processing device includes dithered mixed color image element-forming means for forming, as an additional kind of the dithered image element, a dithered mixed color image element in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the three dithered primary color image elements all of which are commonly assigned the validity-indicative value.
According to these preferred embodiments, the mixed color dithered image element is produced, as a result of a logical AND operation which is performed between corresponding matrix elements of the formed primary color dithered image elements, such that the validity-indicative value is output only when all the matrix elements have a validity-indicative value. In short, the mixed color dithered image element can be created simply by carrying out a relatively simple logical AND operation.
Further preferably, the dithered mixed color image element is formed by carrying out a logical AND operation of matrix elements, corresponding in location, of the three dithered primary color image elements, such that the logical AND operation outputs the validity-indicative value only when the matrix elements of the three dithered primary color image elements all have the validity-indicative value.
Further preferably, the method further includes the step of converting values of matrix elements of the three dithered primary color image elements corresponding in matrix position to the only matrix elements of the dithered mixed color image element which are assigned the validity-indicative value, to the invalidity-indicative value.
Further preferably, the image processing device further includes mixed-color valid matrix elements-deleting means for converting values of matrix elements of the three dithered primary color image elements corresponding in matrix position to the only matrix elements of the dithered mixed color image element which are assigned the validity-indicative value, to the invalidity-indicative value.
According to these preferred embodiments, a mixed color valid matrix element-deleting process is effected, in which out of matrix elements of each of the primary color dithered image elements formed, having the validity-indicative value, each matrix element corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, has its validity-indicative value converted to the invalidity-indicative value. By carrying out this deleting process, out of matrix elements of each of the primary color dithered image elements for the three primary colors, having the validity-indicative value, each matrix element corresponding in matrix element location to each matrix element of the mixed color dithered image element, having the validity-indicative value, has its validity-indicative value canceled.
When primary color dithered image elements for the three primary colors and the mixed color dithered image element for the mixed color of the primary colors are combined with each other (superimposed one upon the other), there is redundancy between each matrix element of the mixed color dithered image element, having the validity-indicative value, and the corresponding matrix elements of the three primary color dithered image elements, commonly having the validity-indicative value. As a result, a mixed color by the primary color dithered image elements for the three primary colors and a mixed color by the mixed color dithered image element are redundant. In the image processing method and device, however, this color redundancy can be avoided by the above cancellation of redundant validity of values of matrix elements. Further, when the above-mentioned four colors of C, M, Y, and K are used, for instance, more attractive black can be obtained in general by printing K (black) by itself than by printing K (black) by actually mixing C (cyan), M (magenta) and Y (yellow), so that as described above, a beautiful image printed by using four colors can be obtained, if the value indicating validity commonly among the corresponding matrix elements of primary color dithered image elements for the three primary colors is canceled.
Still more preferably, the step of converting the values of the matrix elements includes the steps of:
forming an inverted dithered mixed color image element by carrying out a logical NOT operation on matrix elements of the dithered mixed color image element, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value; and
forming updated three dithered primary color image elements by carrying out the logical AND operation between each matrix element of each of the three dithered primary color matrix elements and a corresponding matrix element of the dithered mixed color image element, such that the logical AND operation outputs the validity-indicative value only when the each matrix element and the corresponding matrix element both have the validity-indicative value.
Still more preferably, the mixed-color valid matrix elements-deleting means includes:
inverted dithered mixed color image element-forming means for forming an inverted dithered mixed color image element by carrying out a logical NOT operation on matrix elements of the dithered mixed color image element, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value; and
updated dithered primary color image element-forming means for forming updated three dithered primary color image elements by carrying out the logical AND operation between each matrix element of each of the three dithered primary color matrix elements and a corresponding matrix element of the dithered mixed color image element, such that the logical AND operation outputs the validity-indicative value only when the each matrix element and the corresponding matrix element both have the validity-indicative value.
According to these preferred embodiments, a logical NOT operation for inverting the validity-indicative value and the invalidity-indicative value is carried out on the mixed color dithered image element, to thereby form a inverted dithered mixed color image element. Then, a logical AND operation is performed between each matrix element of each primary color dithered image element and a corresponding one of the matrix elements of the inverted dithered mixed color image element, such that the validity-indicative value is output only when both matrix elements have the validity-indicative value. As a result of the logical AND operation, there are produced dithered image elements which become new primary color dithered image elements. In other words, in this process, by carrying out a relatively simple logical NOT operation and logical AND operation, out of matrix elements of each of the primary color dithered image elements for the three primary colors, having the validity-indicative value, each matrix element corresponding in matrix element location to each matrix element of the mixed color dithered image element, having the validity-indicative value, has its validity-indicative value canceled.
Preferably, if the each of the at least one selected image element is a color image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the step of storing the dither mask comprises the steps of:
storing at least one provisional primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the primary color gradation value;
storing a mixed color dither mask in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the at least one provisional primary color dither mask all of which are commonly assigned the validity-indicative value; and
converting, out of matrix elements of each of the at lest one provisional primary color dither mask which have the validity-indicative value, values of matrix elements corresponding in matrix position to matrix elements of the mixed color dither mask which have the validity-indicative value to the invalidity-indicative value, to thereby form at least one primary color dither mask, respectively, and storing the at least one primary color dither mask; and
the step of forming the dithered image element comprises the step of forming a dithered mixed color image element corresponding to the mixed color dither mask and three dithered primary color image elements corresponding to the at least one primary color dither mask each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the mixed color dither mask and the at least one primary color dither mask as an operand.
Preferably, if the each of the at least one selected image element is a color image, the designated gradation value storage means stores primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the dither mask storage means comprises:
provisional primary color dither mask storage means for storing at least one provisional primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the primary color gradation value;
mixed color dither mask storage means for storing a mixed color dither mask in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the at least one provisional primary color dither mask all of which are commonly assigned the validity-indicative value; and
primary color dither mask storage means for converting, out of matrix elements of each of the at lest one provisional primary color dither mask which have the validity-indicative value, values of matrix elements corresponding in matrix position to matrix elements of the mixed color dither mask which have the validity-indicative value to the invalidity-indicative value, to thereby form at least one primary color dither mask, respectively, and storing the at least one primary color dither mask; and
the dithered image element-forming means forms a dithered mixed color image element corresponding to the mixed color dither mask and three dithered primary color image elements corresponding to the at least one primary color dither mask each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the mixed color dither mask and the at least one primary color dither mask as an operand.
According to these preferred embodiments, when an image element is a color image, at least provisional primary color dither masks corresponding to primary color gradation values of the image element different from each other, are each stored as a type of a dither mask, and a mixed color dither mask is stored, which is obtained by assigning the validity-indicative value only to each matrix element thereof corresponding in matrix element location to matrix elements of all the provisional primary color dither masks, commonly having the validity-indicative value. Further, out of matrix elements of each provisional primary color dither mask, having a validity-indicative value, each matrix element corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, has its validity-indicative value converted to an invalidity-indicative value, and the processed provisional primary color dither mask is stored as a primary color dither mask. Thereafter, a logical AND operation is performed by using the mixed color dither mask and each primary color dither mask, whereby a mixed color dithered image element and each primary color dithered image element corresponding to the mixed color dither mask and each of the primary color dither masks are created as a kind of dithered image element.
In this case, similarly to the above , when the image element is a color image, if all the primary color gradation values of the three primary colors are identical to each other, at least one primary color dithered image element is formed, and when two of the primary color gradation values are identical to each other, at least two primary color dithered image elements are formed. Further, when the three primary color gradation values are all different from each other, at least three primary color dithered image elements are formed. In short, primary color dithered image elements for the three primary colors can be obtained with duplicate use thereof, so that they can be applied to the dithering of the gradation values of three primary colors in a color image element. Further, in this case as well, a provisional primary color dither mask for each of possible primary color gradation values may be stored in advance as a dither mask. Alternatively, a provisional primary color dither mask may be newly formed for storage by comparing a primary color gradation value with each threshold in a dither matrix, after the primary color gradation value is determined. Further, when dither masks corresponding to possible designated gradation values are stored beforehand, after primary color gradation values are determined, a suitable one may be selected from the dither masks and stored as a primary color dither mask again.
Further, according to the image processing method and device, a mixed color dither mask, which is obtained by assigning the validity-indicative value only to each matrix element thereof corresponding in matrix element location to matrix elements of all the provisional primary color dither masks, commonly having the validity-indicative value, is used to carry out a logical AND operation, whereby a mixed color dithered image element corresponding to the mixed color dither mask is formed. Therefore, it is possible to obtain a mixed color dithered image element for use in mixture of the three primary colors, in addition to the above primary color dithered image element in the three primary colors. In short, the dithering of a mixed color can be effected. In the above case, in the primary color dither masks, out of the matrix elements of the provisional primary color dither mask, having the validity-indicative value, each matrix element corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, has its validity-indicative value converted to the invalidity-indicative value, that is, the validity-indicative value of each matrix element of the provisional primary color dither mask, corresponding to each matrix element of the mixed color dithered image element, having the validity-indicative value, is canceled. Therefore, similarly to the above, in each primary color dithered image element formed by using a corresponding primary color dither mask, a validity-indicative value of a matrix element thereof, which is at the same time a validity-indicative value on a side of the mixed color dithered image element, is canceled, whereby image processing can be carried out to obtain a beautiful image, also when the four colors C, M, Y, and K are used as basic colors, for instance.
Still further preferably, if all of the at least one provisional primary color dither mask are formed based on an identical dither matrix, one of the at least one primary color dither mask which contains a minimum number of matrix elements which have the validity-indicative value is stored as the mixed color dither mask.
According to the preferred embodiment of each of the first and second aspects of the invention, a provisional primary color dither mask, which has the smallest number of matrix elements having a validity-indicative value, is stored as a mixed color dither mask. Now, when all the provisional primary color dither masks are formed based on an identical dither matrix, each matrix element having the validity-indicative value in a provisional primary color dither mask having the smallest number of matrix elements having the validity-indicative value, corresponds to matrix elements of the other provisional primary color dither masks, also having the validity-indicative value. That is, in this case, irrespective of how many types (1 to 3 types) of provisional primary color dither masks are provided in a manner corresponding to the three primary colors, matrix elements having the validity-indicative value in a provisional primary color dither mask having the smallest number of matrix elements having the validity-indicative value, corresponds to matrix elements of the other provisional primary color dither masks, also having the validity-indicative value. Therefore, the provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value, can be used as a mixed color dither mask for a mixed color of the three primary colors. It should be noted that the provisional primary color dither masks corresponding to primary color gradation values of the three primary colors can be defined based on the dither matrices having different values from each other. To do this, it is only required to employ the method using the logical AND operation, described hereinafter.
Even more preferably, the mixed color dither mask is one of the at least one provisional primary color dither mask corresponding to one of the primary color gradation values of the three primary colors selected such that the one of the primary color gradation values satisfies the validity condition with respect to a smallest number of thresholds of the dither matrix.
According to the preferred embodiment of each of the first and second aspects of the invention, if a primary color gradation value by which conditions of the smallest number of thresholds in the dither matrix are satisfied, is selected from the gradation values of each of the three primary colors, the mixed color dither mask can be obtained similarly to the case of the provisional primary color dither mask corresponding to a selected primary color gradation value. More specifically, the selection of a primary color gradation value makes it possible to select a provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value, to thereby obtain a mixed color dither mask with ease.
Even further preferably, each of the primary color gradation values satisfies the validity condition when the each of the primary color graduation values is equal to or higher than a corresponding one of the thresholds of the dither matrix, and the one of the primary color gradation values of the three primary colors is selected by selecting a smallest one of the primary color graduation values.
According to the preferred embodiment of each of the first and second aspects of the invention, in a case where if a primary color gradation value is equal to or larger than a threshold, a condition designated by the threshold is satisfied, and a matrix element of the dither mask corresponding to the threshold has the validity-indicative value, a provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value can be selected simply by selecting the smallest primary color gradation value, thereby permitting a mixed color dither mask to be easily obtained.
Even further preferably, each of the primary color gradation values satisfies the validity condition when the each of the primary color graduation values is equal to or lower than a corresponding one of the thresholds of the dither matrix, and wherein the one of the primary color gradation values of the three primary colors is selected by selecting a largest one of the primary color graduation values.
According to the preferred embodiment of each of the first and second aspects of the invention, in a case where if a primary color gradation value is equal to or smaller than a threshold, a condition designated by the threshold is satisfied, and a matrix element of the dither mask corresponding to the threshold has the validity-indicative value, a provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value can be selected simply by selecting the largest primary color gradation value, thereby permitting a mixed color dither mask to be easily obtained.
More preferably, the mixed color dither mask is formed by carrying out the logical AND operation on corresponding matrix elements of the at least one provisional primary color dither mask, such that the logical AND operation outputs the validity-indicative value only when all of the corresponding matrix elements have the validity-indicative value.
According to the preferred embodiment of each of the first and second aspects of the invention, the mixed color dither mask is obtained by carrying out a logical AND operation between corresponding matrix elements of the provisional primary color dither masks such that the validity-indicative value is output only when all the matrix elements have a validity-indicative value. That is, irrespective of whether the provisional primary color dither masks are based on the same dither matrix or not, by carrying out the logical AND operation between the corresponding matrix elements of the provisional dither masks, it is possible to directly obtain matrix elements having the validity-indicative value commonly to all the primary color dither masks, and thereby form the mixed color dither mask.
More preferably, each of the at least one primary color dither mask is formed by carrying out the logical NOT operation on matrix elements of the colored dither, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value, to form an inverted mixed color dither mask, and carrying out the logical AND operation between the inverted mixed color dither mask and each of the at least one provisional primary color dither mask such that the logical AND operation outputs the validity-indicative value only when corresponding matrix elements between the inverted mixed color dither mask and each of the at least one provisional primary color dither mask both have the validity-indicative value.
According to the preferred embodiment of each of the first and second aspects of the invention, each primary color dither mask is created in the following manner: First, a logical NOT operation for inverting the validity-indicative value and the invalidity-indicative value is carried out on the mixed color dither mask, to thereby form the inverted mixed color dither mask. Then, a logical AND operation is performed between each matrix element of each provisional primary color dither mask and a corresponding one of the matrix elements of the inverted mixed color dither mask such that the validity-indicative value is output only when both matrix elements have the validity-indicative value. As a result of the logical AND operation, each primary color dither mask is produced. That is, in this case, the primary color dither mask in which validity of matrix elements having the valid-indicative value in a redundant manner with a corresponding one of the mixed color dither mask is cancelled can be produced simply by carrying out the relatively simple logical NOT operation and the logical AND operation.
More preferably, the three primary colors are cyan, magenta, and yellow.
According to the preferred embodiment of each of the first and second aspects of the invention, the three primary colors are C (cyan), M (magenta) and Y (yellow). Therefore, colors are represented by a so-called subtraction color-mixing method which is suitable for representing colors by using reflection when printing is effected by using an XY plotter, a printer or the like. In this case, mixture of the CMY colors (mixed color) is K (black). In this case, it is preferable that the four colors C, M, Y and K (black) which are set to the basic colors.
Preferably, the dithered image element is formed as a print image for being printed on a print material.
According to the preferred embodiment of each of the first and second aspects of the invention, each dithered image element is created as a print image for being printed on a print material, the present method and device be applied to printers as the image processing method and device for creating print images.
More preferably, matrix elements of the dithered image element which have the validity-indicative value correspond to pixels for which ink is to be ejected from an ink jet head.
According to the preferred embodiment of each of the first and second aspects of the invention, since matrix elements of the dithered image element which have the validity-indicative value correspond to pixels for which ink is to be ejected from an ink jet head, the present method and device are suitably applied to ink jet printing apparatuses.
More preferably, the print material is a tape.
According to the preferred embodiment of each of the first and second aspects of the invention, since the print material on which each dithered image element is printed is a tape, the present method and device can be applied to tape printers.
More preferably, the three primary colors are red, green, and blue.
According to the preferred embodiment of each of the first and second aspects of the invention, the three primary colors are R (red), G (green) and B (blue), and colors can be represented by so-called additive color mixture. In this case, the image processing is suitable for a case where illuminants, such as CRTs, liquid crystal displays, and plasma displays, emit light for representation of colors. In addition, in this case, the mixture (mixed color) of the colors R, G, B results in white.
Preferably, the dithered image element is formed as a display image for being displayed on a display screen.
According to the preferred embodiment of each of the first and second aspects of the invention, since the dithered image element is formed as a display image for being displayed on a display screen, the invention can be applied to display devices etc., as the image processing method and device for creating display images.
To attain the second object, according to a preferred embodiment of the first aspect of the invention, the method further includes the step of forming a corrected dithered image element by correcting the dithered image element based on the elementary object image.
To attain the second object, according to a preferred embodiment of the second aspect of the invention, the image processing device further includes corrected dithered image element-forming means for forming corrected dithered image element by correcting the dithered image element based on the elementary object image.
According to the preferred forms of the first and second aspects of the invention, corrected dithered image element is formed by correcting the dithered image element based on the elementary object image. For instance, in the above elementary shape image, the validity-indicative values are assigned to the matrix elements representative of the pixels of the elementary object image, while the invalidity-indicative values are assigned to the matrix elements representative of the pixels of the elementary background image, so that the boundary (contour line of the elementary object image) between the images is clearly shown. However, as a result of a logical AND operation, the validity-indicative values and the invalidity-indicative values are mixed in matrix elements corresponding to the pixels of the elementary object image in the dithered image element, and hence the validity-indicative values and the invalidity-indicative values can be mixed also in matrix elements corresponding to the contour line of the elementary object image. In such a case, the boundary between the elementary object image and the elementary background image, that is, a portion corresponding to the contour line of the elementary object image is made unclear. To overcome this problem, the dithered image element is corrected based on the elementary object image, whereby it is possible to make clear the portion of the dithered image element, corresponding to the contour line of the elementary object image. Therefore, in the corrected dithered image element as a result of the correction, it becomes possible to prevent formation of the blurs or broken lines in the elementary object image, in addition to the above advantageous effects of the dithered image element.
Therefore, the present image processing method and device permits the dithering to be carried out on a whole image, at least one image element of which has an elementary object image as a body thereof whose pixels are distinguishable from pixels of an elementary background image as the background of the elementary object image, with at least all the pixels of the elementary object image having an identical gradation value, while saving the capacity of the memory device and shortening processing time of the apparatus, as well as preventing formation of so-called blurs or broken lines.
Preferably, the step of forming the corrected dithered image element includes the step of assigning the validity-indicative value of the predetermined two values to matrix elements of the dithered image element which correspond to a contour line of the elementary object image.
Preferably, the corrected dithered image element-forming means includes contour line-redrawing means for assigning the validity-indicative value of the predetermined two values to matrix elements of the dithered image element which correspond to a contour line of the elementary object image.
According to these preferred embodiments, in a case where a print image, formed by carrying out the dithering, is output to the printing apparatus, even if ink is exuded during printing, the print image can be prevented from being made unclear, by the reinforced contour line. Further, as described above, the printing apparatus has the ejection amount-limiting value dependent on a printing object. Therefore, since the printing apparatus has the limited amount (hereinafter referred to as a xe2x80x9cejection amount-limiting valuexe2x80x9d) of ink which can be absorbed per unit area of the printing object, if the dithered image element is corrected in a manner such that the density thereof is uniformly increased, it suffers from the problem that the amount of ink ejected to the printing object exceeds the ejection amount-limiting value. However, in this example, it is only required to reinforce the contour line and further, the outside of the contour line is an area free of ink (area to which the invalidity-indicative value is assigned). Accordingly, a problem of the above-mentioned kind is prevented from occurring.
Further preferably, the step of forming and storing the elementary shape image includes the steps of:
forming an elementary object contour image represented by a two-valued matrix, based on a predetermined outline font, by assigning the validity-indicative value to only matrix elements forming a contour of the elementary object image, and assigning the invalidity-indicative value to the other matrix elements, and storing the elementary object contour image; and
forming the elementary shape image by assigning the validity-indicative value to ones of the other matrix elements which are assigned the invalidity-indicative value, the ones being enclosed by the matrix elements forming the contour of the elementary object image.
Further preferably, the elementary shape image-forming means includes:
elementary object contour image-forming means for forming an elementary object contour image represented by a two-valued matrix, based on a predetermined outline font, by assigning the validity-indicative value to only matrix elements forming a contour of the elementary object image, and assigning the invalidity-indicative value to the other matrix elements, and storing the elementary object contour image; and
elementary object contour-filling means for forming the elementary shape image by assigning the validity-indicative value to ones of the other matrix elements which are assigned the invalidity-indicative value, the ones being enclosed by the matrix elements forming the contour of the elementary object image.
According to these preferred embodiments, first, the validity-indicative value out of the two predetermined values is assigned only to each matrix element forming the contour line of the elementary object image based on a predetermined outline font, while the invalidity-indicative value out of the two predetermined values is assigned to each of the other matrix elements, whereby a character (elementary object) contour image represented by a predetermined binary matrix is produced. Then, out of the matrix elements having the invalidity-indicative values assigned thereto of the elementary object contour line image, matrix elements surrounded by matrix elements forming the contour line of the elementary object image have the validity-indicative values assigned thereto, whereby an elementary shape image represented by an elementary shape image matrix is created.
Since the outline font is defined by coordinates of the contour line and attributes thereof, the process of forming an image based on the outline font is generally executed by carrying out a contour-plotting process (contour line image-forming process: process of assigning validity-indicative values to matrix elements forming the contour line) and a so-called filling process (process of filling the inside of a contour line: process of assigning validity-indicative values to all the matrix elements inside the contour line) for filling a portion inside the contour line plotted. In short, in the above case, the elementary shape image can be easily formed by a general image-forming method carried out based on an outline font.
Further preferably, the step of forming the elementary object contour image includes the step of drawing a contour line of the elementary object image based on the predetermined outline font again onto the dithered image element.
Further preferably, the contour line-redrawing means includes elementary object contour line-redrawing means for drawing a contour line of the elementary object image based on the predetermined outline font again onto the dithered image element.
According to these preferred embodiments, a process similar to the contour-plotting process (contour line image-forming process) in the input character image-forming process (elementary shape image-forming process) is carried out on the dithered image element, that is, a elementary object contour-replotting process for replotting the contour line is executed on the dithered image element, so that it is possible to easily assign the validity-indicative value to matrix elements corresponding to the contour line of the elementary object image of the dithered image element, without additionally providing a new function.
Still more preferably, the step of forming the elementary object contour image includes the step of carrying out the logical OR operation on each matrix element of the dithered image element and a corresponding matrix element of the elementary object contour image such that the logical OR operation causes a corresponding matrix element of the elementary object contour image to have the validity-indicative value when the each matrix element or the corresponding matrix element has the validity-indicative value.
Still more preferably, the contour line-redrawing means includes logical OR operation means for carrying out the logical OR operation on each matrix element of the dithered image element and a corresponding matrix element of the elementary object contour image such that the logical OR operation causes a corresponding matrix element of the elementary object contour image to have the validity-indicative value when the each matrix element or the corresponding matrix element has the validity-indicative value.
According to these preferred embodiments, a logical OR operation is performed between each matrix element of each dithered image element matrix and a corresponding one of the matrix elements of the elementary object contour image matrix, such that each resulting matrix element has the validity-indicative value when either of the matrix elements has the validity-indicative value. That is, in the elementary object contour image matrix, the validity-indicative values are assigned only to matrix elements constituting the contour line of the elementary object image. Hence, a logical OR operation is carried out between the elementary object contour image matrix and the dithered image element matrix, whereby the validity-indicative values can be easily assigned to matrix elements corresponding to the contour line of the elementary object image of the dithered image element matrix. Further, it is only required to perform a logical OR operation, thereby enabling processing time of the apparatus to be shortened.
More preferably, the step of forming the corrected dithered image element includes the step of determining whether or not the elementary object image has a predetermined characteristic, and when it is determined that the elementary object image has the predetermined characteristic, the dithered image element is corrected to set the result image to the corrected dithered image element, and when it is determined that the elementary object image does not have the predetermined characteristic, the dithered image element is directly set to the corrected dithered image element without any correction.
More preferably, the corrected dithered image element-forming means includes elementary object image characteristic-determining means for determining whether or not the elementary object image has a predetermined characteristic, and when it is determined that the elementary object image has the predetermined characteristic, the dithered image element is corrected to set the result image to the corrected dithered image element, and when it is determined that the elementary object image does not have the predetermined characteristic, the dithered image element is directly set to the corrected dithered image element without any correction.
According to these preferred embodiments, it is determined whether or not the elementary object mage has predetermined characteristics. If it is determined that the elementary object mage has the predetermined characteristics, the dithered image element is corrected to a corrected dithered image element (character contour-replotting process). If it is determined that the elementary object mage does not have the predetermined characteristics, the dithered image element is used as a corrected dithered image element. That is, by determining whether or not the elementary object mage has the predetermined characteristics, a dithered image element to be corrected can be limited, and when there are a plurality of dithered image elements, it is possible to shorten whole processing time of the apparatus in comparison with a case where the plurality of dithered image elements are uniformly corrected.
Further preferably, the predetermined characteristic includes a characteristic concerning a size of the elementary object image, and whether or not the elementary object image has the predetermined characteristic is determined based on a dot size.
According to this preferred embodiment of the first and second aspects of the invention, the predetermined characteristics include a characteristic as to the size of the elementary object image. Clarity of a result of the dithering, particularly clarity of a result of so-called thinning depends on the size of the elementary object image, and if attention is paid to one of various sizes which is liable to influence clarity of a result of the dithering, a dithered image element to be corrected can be restricted, thereby enabling efficient correction of dithered images. Further, in the above case, the determination is effected based on general dot sizes, which makes it easy to carry out the dithering.
Further preferably, the predetermined characteristic includes a property that a whole shape of the elementary object image has a size smaller than a predetermined size.
According to this preferred embodiment of the first and second aspects of the invention, the predetermined characteristics include a condition that the whole size of the elementary object image is smaller than a predetermined size. That is, when the whole size of the elementary object image is small, if irregularities in thickness are produced at portions of the contour line or the like by so-called thinning operation, the irregularities become more conspicuous as the whole size of the elementary object image becomes small, which makes it difficult to grasp the original shape of the elementary object image. Therefore, when the whole size of the elementary object image is smaller than the predetermined size, it is possible to enhance clarity of the image and prevent formation of blur or the like by correcting the dithered image element created.
Further preferably, the predetermined characteristic includes a property that a line width of the elementary object image is smaller than a predetermined size.
According to this preferred embodiment of the first and second aspects of the invention, the predetermined characteristics include a condition that the elementary object image has a line width smaller than a predetermined size. In this case, even the character images having the same size can have different line widths dependent on the typeface, and hence there can be a case where it is impossible to carry out appropriate determination by the size of the whole shape of the above mentioned elementary object image alone. Further, even if the general shape can be grasped, if there is a narrow portion, it can be broken. To overcome this inconvenience, when the elementary object image has a line width smaller than a predetermined size, the dithered image element created is corrected thereby making it is possible to enhance clarity of the image and prevent formation of blur or the like.
To attain the third object, according to a third aspect of the invention, there is provided a method of carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with n-valued gradation values (n is an integer which is equal to or larger than 3, and at the same time nxe2x89xa7m) each assigned to a pixel and having any one of n possible numerical values.
The method according to the third aspect of the invention is characterized by comprising the steps of:
forming and storing an elementary shape image represented by a first two-valued matrix of predetermined two values, for each of at least one selected image element of a whole image having at least one image element including the at least one selected image element, the at least one selected image element each having pixels which can be divided into pixels forming an elementary object image and pixels forming an elementary background image as a background of the elementary object image, by assigning a validity-indicative one of the two predetermined values to all of the pixels forming the elementary object image, and an invalidity-indicative one of the two predetermined values to all of the pixels forming the elementary background image;
storing, for each corresponding one of the at least one selected image element, one of the n possible numerical values as a designated gradation value commonly applied to the all of the pixels forming the elementary object image;
determining a corrected gradation value determining means for determining a corrected gradation value based on the designated gradation value;
storing a dither mask represented by a second two-valued matrix of the two predetermined values identical in size to the dither matrix, the second two-valued matrix formed by assigning the validity-indicative one of the predetermined two values to matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the corrected gradation value satisfies a validity condition, and assigning the invalidity-indicative one of the predetermined two value to remaining matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value does not satisfy the validity condition; and
forming a dithered image element represented by a third two-valued matrix of the predetermined two values, the dithered image element being identical in size to the dither mask, by carrying out a logical AND operation between each of matrix elements of each of matrices forming the elementary shape image, the each of the matrices being identical in size to the dither mask, and a corresponding one of the matrix elements and the remaining matrix elements of the dither mask, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements and the corresponding one both have the validity-indicative value.
To attain the third object, according to a fourth aspect of the invention, there is provided an image processing device for carrying out dithering based on a dither matrix in which m-valued thresholds (m is an integer which is equal to or larger than 2) each defined by any one of m possible numerical values are arranged as matrix elements for comparison with n-valued gradation values (n is an integer which is equal to or larger than 3, and at the same time nxe2x89xa7m) each assigned to a pixel and having any one of n possible numerical values.
The image processing device according to the fourth aspect of the invention is characterized by comprising:
elementary shape image-forming means for forming and storing an elementary shape image represented by a first two-valued matrix of predetermined two values, for each of at least one selected image element of a whole image having at least one image element including the at least one selected image element, the at least one selected image element each having pixels which can be divided into pixels forming an elementary object image and pixels forming an elementary background image as a background of the elementary object image, by assigning a validity-indicative one of the two predetermined values to all of the pixels forming the elementary object image, and an invalidity-indicative one of the two predetermined values to all of the pixels forming the elementary background image;
designated gradation value storage means for storing, for each corresponding one of the at least one selected image element, one of the n possible numerical values as a designated gradation value commonly applied to the all of the pixels forming the elementary object image;
corrected gradation value-determining means for determining a corrected gradation value based on the designated gradation value;
dither mask storage means for storing a dither mask represented by a second two-valued matrix of the two predetermined values identical in size to the dither matrix, the second two-valued matrix formed by assigning the validity-indicative one of the predetermined two values to matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the corrected gradation value satisfies a validity condition, and assigning the invalidity-indicative one of the predetermined two value to remaining matrix elements of the dither mask corresponding in matrix position to respective ones of the thresholds of the dither matrix with reference to which the designated gradation value does not satisfy the validity condition; and
dithered image element-forming means for forming a dithered image element represented by a third two-valued matrix of the predetermined two values, the dithered image element being identical in size to the dither mask, by carrying out a logical AND operation between each of matrix elements of each of matrices forming the elementary shape image, the each of the matrices being identical in size to the dither mask, and a corresponding one of the matrix elements and the remaining matrix elements of the dither mask, on a matrix element-by-matrix element basis, such that the logical AND operation outputs the validity-indicative value only when the each of the matrix elements and the corresponding one both have the validity-indicative value.
According to the image processing method and device, a dither mask is stored which is represented by a binary (two-valued) matrix having a size identical to a dither matrix and having two possible predetermined values. More specifically, a matrix is stored as a dither mask, in which a validity-indicative value out of the two predetermined numerical values is assigned to each matrix element corresponding to each threshold of the dither matrix, whose condition is satisfied by a designated gradation value, whereas an invalidity-indicative value out of the two predetermined numerical values is assigned to each matrix element corresponding to each threshold of the dither matrix, whose condition is not satisfied by the designated gradation value.
The dither mask in this case coincides with (the matrix of) a pseudo-gradation image as an image resulting from the binary dither process which is carried out by using the dither matrix on a predetermined gradation image having the same size as that of the dither matrix. In other words, the dither mask coincides with a matrix resulting from a binarization process in which, when a gradation image having the same size as that of the dither matrix has n-valued information per pixel capable of having n possible gradation values, and at the same time information of the gradation values for all the pixels indicates the above designated gradation value, the gradation value of each pixel of the gradation image is compared with a corresponding threshold therefor in the dither matrix and then, the result of the comparison is binarized. It should be noted that in the above case, dither masks for possible designated gradation values may be stored in advance, or a dither mask may be newly produced for storage by comparing a designated gradation value with each threshold in a dither matrix, after the designated gradation value is determined. In the former case, it is possible to omit computing time to shorten processing time.
Further, in the image processing method and device, a corrected gradation value is determined based on each designated gradation value. In this case, since the user""s intention reflects on the designated gradation value, it is possible to cause the user""s intention to reflect on the corrected gradation value produced based on the designated gradation value. Further, since the dithered image element is formed by using a dither mask corresponding to this corrected gradation value, it is also possible to cause the user""s intention to reflect on the dithered image element. On the other hand, the dither mask used in this process corresponds to the designated gradation value not directly but via the corrected gradation value, so that by contriving methods of causing corrected gradation values to correspond to designated gradation values, gradation values can be corrected in various manners according to designated gradation values.
In correcting gradation values, the following method can be contemplated. That is, e.g. when gradation values designated for image elements of a whole image are concentrated within a narrow portion within a value range of n gradation values to make a very slight difference between the designated gradation values, corrected gradation values are determined by enlarging the very slight difference to disperse the gradation values, whereby correction is performed such that a contrast between the image elements is amplified for emphasis on the user""s intention (making a difference between designated gradation values) Further, only when the difference in density between the elementary object image and elementary background image of each image element is small (for instance, when the density of the elementary background image is low with respect to that of the elementary background image), the difference in density is enlarged (to increase the density), whereas when the difference in density is large, corrected gradation values are made identical to designated gradation values, whereby it is possible to prevent formation of blur as well as generation of collapse of dots through value-correcting operations. In the above cases, correcting processing may be branched in a program according to the designated gradation values for determination of corrected gradation values. Alternatively, a table correlating designated gradation values with corrected gradation values may be provided to determine corrected gradation values with reference to the table.
Therefore, the present image processing method and device permit the dithering to be carried out on a whole image, at least one image element of which has an elementary object image as a body or object thereof whose pixels are distinguishable from pixels of an elementary background image as the background of the elementary object image, with at least all the pixels of the elementary object image having an identical gradation value, whereby it is made possible not only to save the memory capacity and shorten processing time of the apparatus but also to reflect the user""s intention as well as correct gradation values to prevent formation of blur and collapse of dots.
Further, the same advantageous effects as provided by the first and second aspects of the invention can be obtained.
Preferably, the step of determining the corrected gradation value includes determining whether the designated gradation value is within a predetermined range for correction, and correcting the designated gradation value to the corrected gradation value when it is determined that the designated gradation value is within the predetermined range for correction, or setting the designated gradation value directly to the corrected gradation value without correction.
Preferably, the corrected gradation value-determining means determines whether the designated gradation value is within a predetermined range for correction, and corrects the designated gradation value to the corrected gradation value when it is determined that the designated gradation value is within the predetermined range for correction, or sets the designated gradation value directly to the corrected gradation value without correction.
According to these preferred embodiments, it is determined whether or not a designated gradation value is within a predetermined correcting range, and if it is within the predetermined range, the designated gradation value is adjusted to set a corrected gradation value, whereas if it is out of the predetermined range, the designated gradation value is determined as a corrected gradation value as it is. That is, by determining whether or not a designated gradation value is within a predetermined range of correction, the designated gradation value to be corrected can be limited within the correcting range, whereby it is possible to reduce generation of problems (collapse of dots and the like) in comparison with uniform correction of designated gradation values. In the above case, as described above, dither masks for possible corrected gradation values may be stored in advance. Alternatively, a dither mask may be newly formed for storage by comparing a corrected gradation value with each threshold in a dither matrix, after the corrected gradation value is determined. In the former case, after the corrected gradation value is determined, a dither mask corresponding to the same may be selected, or a dither mask, which is selected beforehand based on a designated gradation value (identical to a corrected gradation value when the designated gradation value is out of a correcting range), may be selected (changed) based on a corrected gradation value, only when the designated gradation value is determined to be within a correcting range.
More preferably, the predetermined range for correction is a range corresponding to a range of color density lower than a predetermined value.
According to the preferred embodiment of each of the third and fourth aspects of the invention, a predetermined correcting range is determined as a range corresponding to density equal to or lower than a predetermined reference level, whereby a designated gradation value to be corrected can be limited within a range corresponding to the density equal to or lower than the predetermined reference level of density. This makes it possible to exclude a designated gradation value corresponding to high density (density exceeding the predetermined reference level) from a range of designated gradation values to be corrected. As a result, the designated gradation value can be easily corrected such that formation of blur is prevented and at the same time collapse of dots due to a correction operation is also prevented. Especially when an image is output to the printing apparatus, more specifically, when a dithered image element for a print image is formed by carrying out the dithering thereon, if the image is caused to have a corrected gradation value which is further increased in density based on a designated gradation value corresponding to high density, there is a fear that the amount of ink droplets ejected to a printing object exceeds the ejection amount-limiting value as described above. In the present image processing method and device, however, the predetermined correcting range is a range corresponding to density equal to or lower than a predetermined reference level, which causes almost no problems, even if correction operation of uniformly increasing the density of a gradation value in the correcting range, for instance, is carried out without much attention. This enables correction processing to be carried out with ease.
More preferably, the predetermined range for correction is defined based on a ratio of a color density corresponding to the designated gradation value to a maximum color density.
According to the preferred embodiment of each of the third and fourth aspects of the invention, the predetermined correcting range is defined based on a ratio, that is, based on percentage, for instance, of density corresponding to a designated gradation value to the maximum density. This makes it easy to grasp an image of the range of density to be corrected. Further, since the image of the range of density can be easily recognized, it becomes easy to define and change the range of density.
More preferably, the predetermined range for correction is defined as a range of gradation values.
According to the preferred embodiment of each of the third and fourth aspects of the invention, since the predetermined range for correction is defined as a range of gradation values, the determination can be directly carried out from the designated gradation value, and it is easy to effect the determination and to define the range.
More preferably, the predetermined range for correction is defined as a range of numbers of matrix elements of the dither mask to which the validity-indicative value is assigned assuming that the designated gradation value is directly set to the corrected gradation value without correction.
According to the preferred embodiment of each of the third and fourth aspects of the invention, a predetermined correcting range is defined as the range of the number of the matrix elements of a dither matrix, having the validity-indicative value assigned thereto, assuming that a designated gradation value is used as an adjustment value for correction as it is. Density does not necessarily have a predetermined (e.g. linear) relationship with a change in a gradation value, depending on a manner of defining dither matrices, so that in such a case, a desired correcting range can be more easily defined in association with density, if the correcting range is defined by the number of matrix elements having the validity-indicative value assigned thereto in a dither matrix having a predetermined relationship with density. In this case, although the number of the matrix elements of the dither mask, having the validity-indicative value assigned thereto, may be directly counted, this is not limitative, but it is convenient if a table correlating the numbers of matrix elements with designated gradation values and a table correlating the numbers of matrix elements with corrected gradation values are separately provided for reference, or if a table correlating designated gradation values, the numbers of matrix elements of a dither mask, having the validity-indicative value assigned thereto, and corrected gradation values with each other are provided for reference.
Preferably, the predetermined two values are 1 and 0.
Preferably, if the each of the at least one selected image element is a monochrome image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing a gradation value indicative of a shading of the monochrome image as the designated gradation value.
Preferably, if the each of the at least one selected image element is a monochrome image,
the designated gradation value storage means stores a gradation value indicative of a shading of the monochrome image as the designated gradation value.
More preferably, if the each of the at least one selected image element is a color image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the step of determining the corrected gradation value comprises the step of determining a corrected primary color gradation value for each of the primary colors based on a corresponding one of the primary color gradation values, as a kind of the corrected gradation value;
the step of storing the dither mask comprises the step of storing at least one primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the corrected primary color gradation value; and
the step of forming the dithered image element comprises the step of forming three dithered primary color image elements each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the at least one primary color dither mask as an operand.
More preferably, if the each of the at least one selected image element is a color image, the designated gradation value storage means stores primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the corrected gradation value-determining means determines the corrected gradation value comprises the step of determining a corrected primary color gradation value for each of the primary colors based on a corresponding one of the primary color gradation values, as a kind of the corrected gradation value;
the dither mask storage means stores at least one primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the corrected primary color gradation value; and
the dithered image element-forming means forms three dithered primary color image elements each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the at least one primary color dither mask as an operand.
According to these preferred embodiments, when the image element is a color image, primary color gradation values of the three primary colors are stored as types of designated gradation values, corrected primary color gradation values for the primary colors are determined based on the respective primary color gradation values, as kinds of the corrected gradation value, primary color dither masks corresponding to at least two corrected primary color gradation values different from each other are each stored as a type of dither mask, and primary color dithered image elements corresponding to primary color dither masks are formed as kinds of dithered image elements. That is, when all the corrected primary color gradation values of the three primary colors are identical to each other, at least one primary color dithered image element is formed, and when two of the corrected primary color gradation values of the three primary colors are identical to each other, at least two primary color dithered image elements are formed. Further, when the three corrected primary color gradation values are all different from each other, at least three primary color dithered image elements are formed. In this case, when all the corrected primary color gradation values are identical to each other, one primary color dithered image element is made duplicate use of for the three primary colors, and when two of the corrected primary color gradation values are identical to each other, two primary color dithered image elements are made duplicate use of for the two primary colors. In short, primary color dithered image elements for the three primary colors can be obtained. Therefore, the present image processing method and device can be applied to dithering concerning the primary color gradation values of the three primary colors of a color image element.
In the above case, primary color dither masks for possible corrected primary color gradation values may be stored in advance as dither masks. Alternatively, a primary color dither mask may be newly formed for storage by comparing a primary color gradation value with each threshold in a dither matrix, after the primary color gradation value is determined.
Further preferably, the method includes the step of forming, as an additional kind of the dithered image element, a dithered mixed color image element in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the three dithered primary color image elements all of which are commonly assigned the validity-indicative value.
Further preferably, the image processing device includes dithered mixed color image element-forming means for forming, as an additional kind of the dithered image element, a dithered mixed color image element in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the three dithered primary color image elements all of which are commonly assigned the validity-indicative value.
Still more preferably, the dithered mixed color image element is formed by carrying out a logical AND operation of matrix elements, corresponding in location, of the three dithered primary color image elements, such that the logical AND operation outputs the validity-indicative value only when the matrix elements of the three dithered primary color image elements all have the validity-indicative value.
Still more preferably, the method includes the step of converting values of matrix elements of the three dithered primary color image elements corresponding in matrix position to the only matrix elements of the dithered mixed color image element which are assigned the validity-indicative value, to the invalidity-indicative value.
Still more preferably, the image processing device further includes mixed-color valid matrix elements-deleting means for converting values of matrix elements of the three dithered primary color image elements corresponding in matrix position to the only matrix elements of the dithered mixed color image element which are assigned the validity-indicative value, to the invalidity-indicative value.
Still further preferably, the step of converting the values of the matrix elements includes the steps of:
forming an inverted dithered mixed color image element by carrying out a logical NOT operation on matrix elements of the dithered mixed color image element, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value; and
forming updated three dithered primary color image elements by carrying out the logical AND operation between each matrix element of each of the three dithered primary color matrix elements and a corresponding matrix element of the dithered mixed color image element, such that the logical AND operation outputs the validity-indicative value only when the each matrix element and the corresponding matrix element both have the validity-indicative value.
Still further preferably, the mixed-color valid matrix elements-deleting means includes:
inverted dithered mixed color image element-forming means for forming an inverted dithered mixed color image element by carrying out a logical NOT operation on matrix elements of the dithered mixed color image element, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value; and
updated dithered primary color image element-forming means for forming updated three dithered primary color image elements by carrying out the logical AND operation between each matrix element of each of the three dithered primary color matrix elements and a corresponding matrix element of the dithered mixed color image element, such that the logical AND operation outputs the validity-indicative value only when the each matrix element and the corresponding matrix element both have the validity-indicative value.
Preferably, if the each of the at least one selected image element is a color image,
the step of storing the one of the n possible numerical values as the designated gradation value comprises the step of storing primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value;
the step of determining the corrected gradation value comprising the step of determining a corrected primary color gradation value for each of the primary colors based on a corresponding one of the primary color gradation values, as a kind of the corrected gradation value;
the step of storing the dither mask comprising the steps of:
storing at least one provisional primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the corrected primary color gradation value;
storing a mixed color dither mask in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the at least one provisional primary color dither mask all of which are commonly assigned the validity-indicative value; and
converting, out of matrix elements of each of the at lest one provisional primary color dither mask which have the validity-indicative value, values of matrix elements corresponding in matrix position to matrix elements of the mixed color dither mask which have the validity-indicative value to the invalidity-indicative value, to thereby form at least one primary color dither mask, respectively, and storing the at least one primary color dither mask; and
the step of forming the dithered image element comprising the step of forming a dithered mixed color image element corresponding to the mixed color dither mask and three dithered primary color image elements corresponding to the at least one primary color dither mask each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the mixed color dither mask and the at least one primary color dither mask as an operand.
Preferably, if the each of the at least one selected image element is a color image,
the designated gradation value storage means stores primary color gradation values of respective three primary colors of the color image each as a kind of the designated gradation value; and
the corrected gradation value-determining means determines the corrected gradation value comprises the step of determining a corrected primary color gradation value for each of the primary colors based on a corresponding one of the primary color gradation values, as a kind of the corrected gradation value; and
the dither mask storage means comprising:
provisional primary color dither mask storage means for storing at least one provisional primary color dither mask each as a kind of the dither mask, such that a single primary color dither mask corresponds to ones of the primary colors identical in the corrected primary color gradation value;
mixed color dither mask storage means for storing a mixed color dither mask in which the validity-indicative value is assigned to only matrix elements each corresponding in matrix position to matrix elements of the at least one provisional primary color dither mask all of which are commonly assigned the validity-indicative value; and
primary color dither mask storage means for converting, out of matrix elements of each of the at lest one provisional primary color dither mask which have the validity-indicative value, values of matrix elements corresponding in matrix position to matrix elements of the mixed color dither mask which have the validity-indicative value to the invalidity-indicative value, to thereby form at least one primary color dither mask, respectively, and storing the at least one primary color dither mask; and
the dithered image element-forming means forming a dithered mixed color image element corresponding to the mixed color dither mask and three dithered primary color image elements corresponding to the at least one primary color dither mask each as a kind of the dithered image element by carrying out the logical AND operation by using a corresponding one of the mixed color dither mask and the at least one primary color dither mask as an operand.
According to these preferred embodiments, when an image element is a color image, at least provisional primary color dither masks corresponding to corrected primary color gradation values of the image element different from each other, are each stored as a type of a dither mask, and a mixed color dither mask is stored, which is obtained by assigning the validity-indicative value only to each matrix element thereof corresponding in matrix element location to matrix elements of all the provisional primary color dither masks, commonly having the validity-indicative value. Further, out of matrix elements of each provisional primary color dither mask, having the validity-indicative value, each matrix element corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, has its validity-indicative value converted to the invalidity-indicative value, and the processed provisional primary color dither mask is stored as a primary color dither mask. Thereafter, a logical AND operation is performed by using the mixed color dither mask and each primary color dither mask, whereby a mixed color dithered image element corresponding to the mixed color dither mask and primary color dithered image elements corresponding to the primary color dither masks are created as kinds of dithered image elements.
In this case, similarly to the above , when the image element is a color image, if all the corrected primary color gradation values of the three primary colors are identical to each other, at least one primary color dithered image element is formed, and when two of the corrected primary color gradation values are identical to each other, at least two primary color dithered image elements are formed. Further, when the three corrected primary color gradation values are all different from each other, at least three primary color dithered image elements are formed. In short, primary color dithered image elements for the three primary colors can be obtained with duplicate use thereof, so that they can be applied to the dithering of the gradation values of three primary colors in a color image element. Further, in this case as well, provisional primary color dither masks for possible corrected primary color gradation values may be stored in advance as dither masks. Alternatively, a provisional primary color dither mask may be newly formed for storage by comparing a primary color gradation value with each threshold in a dither matrix, after the corrected primary color gradation value is determined. Further, when dither masks corresponding to possible designated gradation values are stored beforehand, after corrected primary color gradation values are determined, a suitable one may be selected from the dither masks and stored as a primary color dither mask again.
Further, according to the image processing method and device, a mixed color dither mask is employed to carry out a logical AND operation, whereby a mixed color dithered image element corresponding to the mixed color dither mask is formed. Therefore, it is possible to obtain a mixed color dithered image element for a mixed color of the three primary colors, in addition to the above primary color dithered image element in the three primary colors. In short, the dithering of a mixed color can be effected. In the above case, in the primary color dither masks, out of the matrix elements of the provisional primary color dither mask, having the validity-indicative value, each matrix element corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, has its validity-indicative value converted to the invalidity-indicative value, that is, the validity-indicative value of each matrix element of the provisional primary color dither mask, corresponding to each matrix element of the mixed color dither mask, having the validity-indicative value, is canceled. Therefore, similarly to the above, in each primary color dithered image element formed by using the corresponding primary color dither mask, the validity-indicative value of each matrix element thereof, corresponding to each matrix element of the mixed color dithered image element, having the validity-indicative value, is canceled, whereby image processing can be effected to obtain a beautiful image, also when the four colors C, M, Y, and K, for instance, are used as the basic colors.
More preferably, if all of the at least one provisional primary color dither mask are formed based on an identical dither matrix, one of the at least one primary color dither mask which contains a minimum number of matrix elements which have the validity-indicative value is stored as the mixed color dither mask.
According to this preferred embodiment of the third and fourth aspects of the invention, a provisional primary color dither mask, which has the smallest number of matrix elements having a validity-indicative value, is stored as a mixed color dither mask. Now, when all the provisional primary color dither masks are formed based on an identical dither matrix, each matrix element having the validity-indicative value in a provisional primary color dither mask having the smallest number of matrix elements having the validity-indicative value, corresponds to matrix elements of the other provisional primary color dither masks, also having the validity-indicative value. That is, in this case, irrespective of how many types (1 to 3 types) of provisional primary color dither masks are provided in a manner corresponding to the three primary colors, each matrix element having the validity-indicative value in the provisional primary color dither mask having the smallest number of matrix elements having the validity-indicative value, becomes a matrix element common to all the provisional primary color dither mask and having the validity-indicative value. Therefore, the provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value can be used as a mixed color dither mask for the mixed color of the three primary colors. It should be noted that the provisional primary color dither masks corresponding to corrected primary color gradation values of the three primary colors can be defined based on the dither matrices having different values from each other. To do this, it is only required to employ the method using the logical AND operation, described hereinafter.
More preferably, the mixed color dither mask is one of the at least one provisional primary color dither mask corresponding to one of the corrected primary color gradation values of the three primary colors selected such that the one of the corrected primary color gradation values satisfies the validity condition with respect to a smallest number of thresholds of the dither matrix.
According to this preferred embodiment of the third and fourth aspects of the invention, if a primary color gradation value satisfying conditions of the smallest number of thresholds in the dither matrix, is selected from the gradation values of each of the three primary colors, the mixed color dither mask can be obtained similarly to the case of the provisional primary color dither mask corresponding to a selected primary color gradation value. More specifically, the selection of a primary color gradation value makes it possible to select a provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value, thereby obtaining a mixed color dither mask with ease.
Further preferably, each of the corrected primary color gradation values satisfies the validity condition when the each of the corrected primary color graduation values is equal to or higher than a corresponding one of the thresholds of the dither matrix, and the one of the corrected primary color gradation values of the three primary colors is selected by selecting a smallest one of the corrected primary color graduation values.
According to this preferred embodiment of the third and fourth aspects of the invention, if, in a case where a corrected primary color gradation value is equal to or larger than a threshold, a condition designated by the threshold is satisfied, and a matrix element of the dither mask corresponding to the threshold has the validity-indicative value, a provisional primary color dither mask which has the smallest number of matrix elements having a validity-indicative value can be selected simply by selecting the minimum corrected primary color gradation value, whereby a mixed color dither mask can be easily obtained.
Even further preferably, each of the primary color gradation values satisfies the validity condition when the each of the corrected primary color graduation values is equal to or lower than a corresponding one of the thresholds of the dither matrix, and wherein the one of the corrected primary color gradation values of the three primary colors is selected by selecting a largest one of the corrected primary color graduation values.
According to the preferred embodiment of each of the third and fourth aspects of the invention, in a case where if a corrected primary color gradation value is equal to or smaller than a threshold, a condition designated by the threshold is satisfied, and a matrix element of the dither mask corresponding to the threshold has the validity-indicative value, a provisional primary color dither mask which has the smallest number of matrix elements having the validity-indicative value can be selected simply by selecting the maximum corrected primary color gradation value, whereby a mixed color dither mask can be easily obtained.
More preferably, the mixed color dither mask is formed by carrying out the logical AND operation on corresponding matrix elements of the at least one provisional primary color dither mask, such that the logical AND operation outputs the validity-indicative value only when all of the corresponding matrix elements have the validity-indicative value.
More preferably, each of the at least one primary color dither mask is formed by carrying out the logical NOT operation on matrix elements of the colored dither, such that the logical NOT operation outputs inverted values of the validity-indicative value and the invalidity-indicative value, to form an inverted mixed color dither mask, and carrying out the logical AND operation between the inverted mixed color dither mask and each of the at least one provisional primary color dither mask such that the logical AND operation outputs the validity-indicative value only when corresponding matrix elements between the inverted mixed color dither mask and each of the at least one provisional primary color dither mask both have the validity-indicative value.
More preferably, the three primary colors are cyan, magenta, and yellow.
Preferably, the dithered image element is formed as a print image for being printed on a print material.
More preferably, matrix elements of the dithered image element which have the validity-indicative value correspond to pixels for which ink is to be ejected from an ink jet head.
Preferably, the print material is a tape.
More preferably, the three primary colors are red, green, and blue.
Preferably, the dithered image element is formed as a display image for being displayed on a display screen.
Preferably, the method further includes the step of entering a character including a letter, a numeral, a symbol, and a figure, as text data,
the elementary shape image being formed by creating a character image corresponding to the text data of the entered character, based on predetermined font data.
Preferably, the image processing device further includes character entry means for entering a character including a letter, a numeral, a symbol, and a figure, as text data; and
font data storage means for storing predetermined font data;
the elementary shape image being formed by creating a character image corresponding to the text data of the entered character, based on the predetermined font data.
According to these preferred embodiments, the elementary shape image is formed by entering a character including a letter, a numeral, a symbol, or a figure as text data, and a character image is formed from the entered text data of the character based on predetermined font data. That is, according to this image processing method and device, the elementary shape image can be easily formed by a general image-forming (code-conversion) method by using the predetermined font data, which can be an outline font or a dot font (bit map font).
The above and other objects, features, and advantageous of the invention will become more apparent from the detailed description taken in conjunction with the accompanying drawings.